package org.rain.core.rbac.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.rain.common.util.tree.ITree;
import org.rain.core.model.PersistenceModel;

import java.util.List;

/**
 * created by yangtong on 2025/4/8 14:14:32
 * <br/>
 * 部门
 */
@Data
@TableName("depart")
public class Depart extends PersistenceModel<Depart> implements ITree<Depart> {
    /**
     * 上级部门id
     */
    private String pid;
    /**
     * 部门名称
     */
    private String departName;

    /**
     * 部门编码
     */
    private String departCode;

    /**
     * 部门状态
     */
    private Integer departStatus;

    /**
     * 部门联系人username
     */
    private String contactUserName;

    /**
     * 部门地址
     */
    private String address;

    /**
     * 子元数集合
     */
    @TableField(exist = false)
    private List<Depart> children;

    @Override
    public String getKey() {
        return this.departName;
    }

}
